
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="commons/meta.jsp"%>
<%@ include file="commons/tags.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>智汇管理</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}

.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}

.STYLE6 {
	color: #000000;
	font-size: 12;
}

.STYLE10 {
	color: #000000;
	font-size: 12px;
}

.STYLE19 {
	color: #344b50;
	font-size: 12px;
}

.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}

.STYLE22 {
	font-size: 12px;
	color: #295568;
}

-->
a:hover {
	background-color: white;
}

a:visited {
	color: #C71585;
	background-color: white;
}
</style>
<link rel="stylesheet" href="${ctx}/css/themes/jquery-ui-1.8.23.custom.css" />
<script src="${ctx}/js/jquery-1.8.0.min.js"></script>
<script src="${ctx}/js/jquery-ui-1.8.23.custom.min.js"></script>
<script src="${ctx}/js/jquery.ui.datepicker-zh-CN.js"></script>
<script>
$(function() {
	$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
	$("#fromDate").datepicker({
		changeMonth : true,
		changeYear : true,
		showButtonPanel : true,
		onSelect : function(selectedDate) {
			$("#toDate").datepicker("option", "minDate", selectedDate);
		}
	});
	$("#toDate").datepicker({
		changeMonth : true,
		changeYear : true,
		showButtonPanel : true,
		onSelect : function(selectedDate) {
			$("#fromDate").datepicker("option", "manDate", selectedDate);
		}
	});
	$("#chkall").click(function() {
		$('input[name="zId"]').attr("checked", this.checked);
	});
	$("#first").click(function() {
		$("#pageNo").val(1);
		$("#pageForm").submit();
		return false;
	});
	$("#pre").click(function() {
		no = parseInt($("#pageNo").val()) - 1;
		$("#pageNo").val(no);
		$("#pageForm").submit();
		return false;
	});
	$("#next").click(function() {
		no = parseInt($("#pageNo").val()) + 1;
		$("#pageNo").val(no);
		$("#pageForm").submit();
		return false;
	});
	$("#last").click(function() {
		$("#pageNo").val($("#total").val());
		$("#pageForm").submit();
		return false;
	});
	$("#jump").click(function() {
		no = $.trim($("#jumpNo").val());
		if(no==""){
			alert("请输入正确的页码");
			return false;
		}
		total = parseInt($("#total").val());
		if (no < 1)
			no = 1;
		if (no > total)
			no = total;
		$("#pageNo").val(no);
		$("#pageForm").submit();
		return false;
	});
	$("#delselect").click(function() {
		var ids = $("input[name='zId']:checked").length;
		if (ids > 0) {
			$("#pageForm").attr("action", "${ctx}/zhihui/dropZhihui");
			$("#pageForm").submit();
		} else {
			alert("请选择要删除的内容");
		}
		return false;
	});
});
function showCommentDialog() {
	$("#comment_dialog").load("comment.jsp").dialog({
		modal : true,
		height : 400,
		width : 900
	});
}

function del(id){

	$('input[name="zId"]').attr("checked", false);
	$("#delId").val(id);
	$("#pageForm").attr("action", "${ctx}/zhihui/dropZhihui");
	$("#pageForm").submit();
	return false;
}
</script>
</head>

<body>
	<table width="100%" border="0" align="center" cellpadding="0"
		cellspacing="0">
		<tr>
			<td><table cellspacing="2">
					<tr>
						<td><form action="${ctx}/zhihui/query" method="post">
						<input type="hidden" name="nowPage" value="1"/>
								<span class="STYLE10">关键字：<input type="text" name="zName"/></span><span class="STYLE10">发布时间 从：<input
									type="text" id="fromDate" readonly="true" name="bDate"/> 至 <input
									type="text" id="toDate" readonly="true" name="eDate"/></span><span style="">
									<input type="submit" value="搜索" />
								</span>
							</form></td>
					</tr>
				</table></td>
		</tr>
		</table>
	<form id="pageForm" name="pageForm" action="${ctx }/zhihui/query"
		method="post">
		<input type="hidden" id="delId" name="zId" />
		<table width="100%" border="0" align="center" cellpadding="0"
			cellspacing="0">
		<tr>
			<td height="30"><table width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr>
						<td height="24" bgcolor="#353c44"><table width="100%"
								border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td><table width="100%" border="0" cellspacing="0"
											cellpadding="0">
											<tr>
												<td width="6%" height="19" valign="bottom"><div
														align="center">
														<img src="images/tb.gif" width="14" height="14" />
													</div></td>
												<td width="94%" valign="bottom"><span class="STYLE1">
														管理人员基本信息列表</span></td>
											</tr>
										</table></td>
									<td><div align="right">
												<span class="STYLE1"><img src="${ctx}/images/add.gif"
													width="10" height="10" /> <a href="${ctx }/shijie_add">添加</a>
													&nbsp; <img src="${ctx}/images/del.gif" width="10"
													height="10" /> <a id="delselect" href="">删除</a>
													&nbsp;&nbsp; </span><span class="STYLE1"> &nbsp;</span>
											</div></td>
								</tr>
							</table></td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td><table width="100%" border="0" cellpadding="0"
					cellspacing="1" bgcolor="#a8c7ce">
					<tr>
						<td width="4%" height="20" bgcolor="d3eaef" class="STYLE10"><div
								align="center">
								<input type="checkbox" id="chkall" name="chkall" />
							</div></td>
						<td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">文章标题</span>
							</div></td>
						<td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">文章内容</span>
							</div></td>
						<td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">标签</span>
							</div></td>
						<td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">权重</span>
							</div></td>
						<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">发布时间</span>
							</div></td>
						<td width="7%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">发布者</span>
							</div></td>
						
						<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
								align="center">
								<span class="STYLE10">基本操作</span>
							</div></td>
					</tr>
					<c:forEach items="${page.dataArray}" var="zhList">
						<tr>
							<td height="20" bgcolor="#FFFFFF"><div align="center">
									<input type="checkbox" name="zId" id=zId value="${zhList.zhihuiId}"/>
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE6"><div
									align="center">
									<span class="STYLE19">${zhList.title}</span>
								</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">${zhList.content}</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">${zhList.tag}</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">${zhList.weight}</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">
									<fmt:formatDate value="${zhList.publishdate}" type="both"/>
									</div></td>
							<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
									align="center">${zhList.username}</div></td>
					
							<td height="20" bgcolor="#FFFFFF"><div align="center"
									class="STYLE21">
									<a href="#"
											onclick="del(${zhList.zhihuiId})">删除</a>  | <a href="${ctx}/zhihui/queryZhihui?zid=${zhList.zhihuiId}">修改</a>
								</div></td>
						</tr>
					</c:forEach>

				</table></td>
		</tr>
		<tr>
			<td height="30"><table width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr>
						<td width="33%"><div align="left">
								<span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong>
										${page.pageCount }</strong> 条记录，当前第<strong> ${page.pageNum }</strong> 页，共 <strong>${page.pageTotal }</strong> 页
								</span>
							</div></td>
						<td width="67%">
								<input type="hidden" id="pageNo" name="nowPage"
									value="${page.pageNum }" /><input type="hidden" id="title" name="zName"
									value="${zName }" /> <input type="hidden" id="startDate"
									name="bDate" value="${bDate }" /> <input type="hidden"
									id="endDate" name="eDate" value="${eDate }" /> <input
									type="hidden" id="total" name="total"
									value="${page.pageTotal }" />
								<table width="312" border="0" align="right" cellpadding="0"
									cellspacing="0">
									<tr>
										<td width="49"><div align="center">
												<span class="STYLE22"> <c:if var="first"
														test="${page.pageNum le 1 }">
														首页
											</c:if> <c:if test="${not first}">
														<a id="first" href="">首页</a>
													</c:if></span>
											</div></td>
										<td width="49"><div align="center">
												<span class="STYLE22"> <c:if var="pre"
														test="${page.pageNum gt 1 }">
														<a id="pre" href="">上一页</a>
													</c:if> <c:if test="${not pre }">
												上一页
												</c:if>
												</span>
											</div></td>
										<td width="49"><div align="center">
												<span class="STYLE22"> <c:if var="next"
														test="${page.pageNum lt page.pageTotal }">
														<a id="next" href="">下一页</a>
													</c:if> <c:if test="${not next }">
												下一页
												</c:if>
												</span>
											</div></td>
										<td width="49"><div align="center">
												<span class="STYLE22"> <c:if var="last"
														test="${page.pageNum ge page.pageTotal }">
														尾页
													</c:if> <c:if test="${not last }">
														<a id="last" href="">尾页</a>
													</c:if></span>
											</div></td>
										<td width="37" class="STYLE22"><div align="center">转到</div></td>
										<td width="22"><div align="center">
												<input type="text" name="jumpNo" id="jumpNo"
													style="width: 20px; height: 12px; font-size: 12px; border: solid 1px #7aaebd;" />
											</div></td>
										<td width="22" class="STYLE22"><div align="center">页</div></td>
										<td width="35"><span class="STYLE22"><a id="jump">GO</a></a></span></td>
									</tr>
								</table>
							</td>
					</tr>
				</table></td>
		</tr>
	</table>
	</form>
</body>
</html>
